<?php
namespace Twoir\System\Model;

use Twoir\System\Support\BothTrait;
use Twoir\System\Support\ParseTrait;

/**
 * 会员模型，字段和默认值设置
 * 
 * 【注意事项】有增减字段，请更新 字段：FIELD自定义区和默认值：MYDEFAULT自定义区，没有更新请勿动！！！
 * cighsen02 365182575
 * time: 2022.06.20
*/
class EnewsMember
{
	use BothTrait, ParseTrait;
	
	const TABLE = [
		'pri' 	=> 'enewsmember',
		'sec' 	=> 'enewsmemberadd',//副表
	];
	
	//主键
	const PRIMARY = 'userid';
	
	const FIELD = [
		'pri' => [
			//系统字段
			'userid',
			'username',
			'password',
			'rnd',
			'email',
			'registertime',
			'groupid',
			'userfen',
			'userdate',
			'money',
			'zgroupid',
			'havemsg',
			'checked',
			'salt',
			'userkey',
			'ingid',
			'agid',
			'isern'
			
			//自定义字段
			
		],
		'sec' => [
			//系统字段
			'userid',
			'spacestyleid',
			'spacename',
			'spacegg',
			'viewstats',
			'regip',
			'lasttime',
			'lastip',
			'loginnum',
			'regipport',
			'lastipport',
			
			//自定义字段(帝国预安装内置的字段)
			'company',
			'truename',
			'mycall',
			'fax',
			'phone',
			'oicq',
			'msn',
			'homepage',
			'userpic',
			'address',
			'zip',
			'saytext'
		],
	];
	
	/**
	 * 默认值
	 */
	const MYDEFAULT = [
		//主表
		'pri' => [
			//系统字段
			'userid'		=> null,
			'username'		=> '',
			'password'		=> '',
			'rnd'			=> '',
			'email'			=> '',
			'registertime'	=> 0,
			'groupid'		=> 0,
			'userfen'		=> 0,
			'userdate'		=> 0,
			'money'			=> 0,
			'zgroupid'		=> 0,
			'havemsg'		=> 0,
			'checked'		=> 0,
			'salt'			=> '',
			'userkey'		=> '',
			'ingid'			=> 0,
			'agid'			=> 0,
			'isern'			=> 0
			
			//自定义字段
			
		],
		
		//副表
		'sec' => [
			//系统字段
			'userid'		=> null,
			'spacestyleid'	=> 0,
			'spacename'		=> '',
			'spacegg'		=> '',
			'viewstats'		=> 0,
			'regip'			=> '',
			'lasttime'		=> 0,
			'lastip'		=> '',
			'loginnum'		=> 0,
			'regipport'		=> '',
			'lastipport'	=> '',
			
			//自定义字段(帝国预安装内置的字段)
			'company'		=> '',
			'truename'		=> '',
			'mycall'		=> '',
			'fax'			=> '',
			'phone'			=> '',
			'oicq'			=> '',
			'msn'			=> '',
			'homepage'		=> '',
			'userpic'		=> '',
			'address'		=> '',
			'zip'			=> '',
			'saytext'		=> ''
		]
	];
}